<template>
	<view class="box">
		<u-tabs :list="list1" @click="click"></u-tabs>
		<view class="box1">


			<u-cell :title="`第${index + 1}名`" size="large" v-for="(item, index) in paihangList" :key="index"
				class="cell-box">
				<view class="box3" slot="label">
					<view class="box3">
						<view class="box2-1">
							{{item.name}}
						</view>

						<view class="box2">
							<u-tag text="分数" plain size="mini"></u-tag>
							<text class="wenben">{{`${item.zongfen}`}}</text>
						</view>
						<view class="box2">
							<u-tag text="时间" plain size="mini" type="warning"></u-tag>
							<text class="wenben">{{`${item.shijian}秒`}}</text>
						</view>
					</view>
					<view class="" v-if="current==0">
						<u-tag :text="item.teamname" type="warning"></u-tag>

					</view>

				</view>
			</u-cell>

		</view>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				list1: [{
					name: '选手榜',
				}, {
					name: '场外观众榜',
				}, ],
				paihangList: [],
				current: 0
			}
		},
		onShow() {
			this.getpaihang(0)
		},
		methods: {
			scrolltolower() {},
			click(item) {
				console.log('item', item);
				this.current = item.index
				this.getpaihang(item.index)
			},
			qiehuan(index) {
				this.current = index
				this.getpaihang(index)
			},
			getpaihang(index) {
				uniCloud.callFunction({
					name: 'get-paihang',
					data: {
						index: index
					}
				}).then(res => {
					console.log(res)
					this.paihangList = res.result.data
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	page {
		background: #000;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		height: 100%;
	}

	.box {
		width: 1500px;
		height: 800px;
		background: #fff;
		overflow: hidden;
		display: flex;
		flex-direction: column;
		align-items: center;
		padding: 50px;
	}

	.box1 {
		width: 100%;
		flex: 1;
		background: #fff;
		overflow: hidden;
		overflow-y: scroll;
		display: flex;
		flex-direction: column;
		align-items: center;
		// border: 1px solid #ff0000;
	}

	.box2 {
		display: flex;
		flex-direction: row;
		align-items: center;
		margin-top: 16px;
		// width: 80px;
		font-size: 18px;
		line-height: 18px;
		font-weight: bold;
		margin-right: 20px;
	}

	.box2-1 {
		display: flex;
		flex-direction: row;
		align-items: center;
		margin-top: 16px;
		width: 80px;
		font-size: 18px;
		line-height: 18px;
		font-weight: bold;
	}

	.wenben {
		margin-left: 5px;
	}

	.box3 {
		display: flex;
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
	}

	.cell-box {
		width: 100%;
	}
</style>
